package com.mingzhi.loggingservice.mapper;

import com.mingzhi.loggingservice.entity.OperationLogs;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface OperationLogsMapper {

    /**
     * 添加日志
     * @param operationLogs
     * @return
     */
    @Insert("insert into operation_logs(user_id, action, ip, detail) values(#{userId}, #{action}, #{ip}, #{detail})")
    @Options(useGeneratedKeys = true, keyProperty = "logId")
    Integer insert(OperationLogs operationLogs);
}
